import store from '@/store'

export const imgerror = {
  inserted: (el, options) => {
    el.onerror = () => {
      el.src = options.value
    }
  }
}
// 自定义指令 控制按钮权限显示隐藏
export const allow = {
  inserted: (el, options) => {
    // console.log(options.value, 'options')
    // console.log(el, 'el')
    const points = store.state.user.userInfo.roles.points
    // 所有的按钮权限数据
    // console.log(points, 'points')
    if (!points.includes(options.value)) {
      el.style.display = 'none'
    }
  }
}
